
# 自定义返回字段
def jwt_response_payload_handler(token, user, request):
    return {
        'token': token,
        'id': user.id,
        'username': user.username,
    }

# 自定义有效载荷 payload
def jwt_payload_handler(user):
    return {
        'user_id': user.id,
        'username': user.username,
        'mobile': user.mobile
    }

# 获取当月所有日期
import calendar
import pandas as pd
from datetime import datetime
def get_month_date_range(date):
    last_day = calendar.monthrange(date.year, date.month)[1]
    # print(last_day, 'last_day')  #  31
    return pd.date_range(start=datetime(date.year, date.month, 1), end=datetime(date.year, date.month, last_day))

if __name__ == "__main__":
    date = datetime.today().date()
    print(date)
    date_range = get_month_date_range(date)
    print(date_range)